package service

import (
	"zhonghui/console/warehouse/dbx/db_zh_kernel"
	"zhonghui/console/warehouse/logx"
)

func PhoneToIds(phone string) string {
	data := struct {
		Id        uint64
		Phone     string
		PolicyIds string
	}{}
	db_zh_kernel.Client().Table("upgrade_list").Where("phone = ?", phone).Take(&data)

	if data.PolicyIds == "" {
		logx.Zap().Errorw("查询升级id错误", "phone", phone)
		return ""
	}

	return data.PolicyIds
}
